from asyncio import gather

import pytest
import os
from common.Yaml import Yaml
from common.Request import Request
from common.Path import project_path
import allure
filepath=project_path()
#读取插件采集页yaml文件
gather_yaml_file=os.path.join(filepath,"api", "goods","draft", "gather.yaml")
gather_yaml_data = Yaml(gather_yaml_file).read_yaml()
json_dict=gather_yaml_data['data']

base_url="http://www.dfalpha.com"
headers = {
    "loginUserY": "YjNjLTg2MjktZDAxOTYwZTcwNGZ",
    "loginUserH": "jIiwidXNlcm5hbWUiOiJkZnRlc3QtaHR4In0.SeVEgecG75esvrSUQOHZK16VReeR_KNtux7it4sQOBQ",
    "loginUserL": "eyJhbGciOiJIUzI1NiJ9.eyJ1dWlkIjoiMWQ5YzA0M2ItZGViMy00"
}
#实例化域名
req=Request(base_url)

def test_gather():
    response=req.send_request(method="POST",url=base_url+"/api/pub/gather/gather.json",json=json_dict,headers=headers).json()
    return response



